<template>
    <div id="toolbar">
        <div class="header">
            <div class="logo">
                <img @click="avatarClick" src="http://pic.58pic.com/58pic/13/60/27/72h58PICgzY_1024.jpg">
            </div>
        </div>
        <div class="toolbar-list">
            <a v-link="{path: '/home'}"><i class="glyphicon glyphicon-home"></i></a>
            <a v-link="{path: '/star'}"><i class="glyphicon glyphicon-star"></i></a>
            <a v-link="{path: '/profile'}"><i class="glyphicon glyphicon-user"></i></a>
            <a v-link="{path: '/cog'}"><i class="glyphicon glyphicon-cog"></i></a>
        </div>
    </div>
</template>
<script>
    export default{
        data(){
            return {
                msg: 'hello vue'
            }
        },
        methods: {
            avatarClick: function (e) {
                window.open(e.target.src)
            }
        }
    }
</script>

<style lang="scss" scoped>
    $bgColor: #1a231f;
    #toolbar {
        width: 80px;
        height: 100%;
        background-color: $bgColor;

        .header {
            flex: 1;
            padding: 30px 0 20px 0;
            .logo {
                display: flex;
                justify-content: center;
                img {
                    width: 60px;
                    height: 60px;
                    border: 2px solid #fff;
                    border-radius: 50%;
                }
            }
        }

        .toolbar-list {
            flex-direction: column;
            display: flex;
            justify-content: center;
            text-align: center;
            a {
                flex: 1;
                align-self: center;
                padding: 15px 0;
                color: #fff;
                i {
                    color: #bbb;
                    font-size: 30px;
                }

                &.v-link-active i{
                    color: #f7ca0f;
                }

                &:last-child:not(:first-child){
                    position: absolute;
                    bottom: 20px;
                    align-self: center;
                }
            }
        }
    }
</style>
